
pkgname=automake
pkgver=1.16.1
pkgrel=1
pkgdesc="A GNU tool for automatically creating Makefiles"
arch=('x86_64')
license=('GPL')
url="https://www.gnu.org/software/automake"
groups=('base-devel')
depends=('perl' 'bash')
makedepends=('autoconf')
checkdepends=('dejagnu' 'python2' 'java-environment' 'vala' 'emacs-nox' 'gcc-fortran')
source=("https://ftp.gnu.org/gnu/automake/${pkgname}-${pkgver}.tar.xz")
md5sums=('53f38e7591fa57c3d2cee682be668e5b')

build() {
  cd ${pkgname}-${pkgver}
  # Fix a warning that is caused by perl-5.22 and later
  sed -i 's:/\\\${:/\\\$\\{:' bin/automake.in
  
  ./configure --prefix=/usr
  make
}

check(){
  cd ${pkgname}-${pkgver}
  # see http://www.linuxfromscratch.org/lfs/view/development/chapter06/automake.html
  sed -i "s:./configure:LEXLIB=/usr/lib/libfl.a &:" t/lex-{clean,depend}-cxx.sh
 
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  
  make DESTDIR=${pkgdir} install
}

